//
//  IncomeDetailsTableViewCell.m
//  fxxiaoke
//
//  Created by 鞠超 on 16/9/26.
//  Copyright © 2016年 jc. All rights reserved.
//

#import "IncomeDetailsTableViewCell.h"

@implementation IncomeDetailsTableViewCell

- (instancetype )initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self)
    {
        [self p_setupView];
    }
    
    return self;
}

- (void )p_setupView
{
    self.lbl_name = [[UILabel alloc] init];
    self.lbl_name.textColor = [UIColor blackColor];
    self.lbl_name.font = [UIFont systemFontOfSize:17.0f];
    [self.contentView addSubview:self.lbl_name];
    
    self.lbl_detail = [[UILabel alloc] init];
    self.lbl_detail.textColor = [UIColor grayColor];
    self.lbl_detail.font = [UIFont systemFontOfSize:15.0f];
    [self.contentView addSubview:self.lbl_detail];
    
    self.lbl_time = [[UILabel alloc] init];
    self.lbl_time.textColor = [UIColor grayColor];
    self.lbl_time.font = [UIFont systemFontOfSize:15.0f];
    [self.contentView addSubview:self.lbl_time];
    
    self.view_Line = [[UIView alloc] init];
    self.view_Line.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:self.view_Line];
    
    self.lbl_price = [[UILabel alloc] init];
    self.lbl_price.textColor = [UIColor blackColor];
    self.lbl_price.font = [UIFont systemFontOfSize:17.0f];
    self.lbl_price.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:self.lbl_price];
}

- (void )layoutSubviews
{
    [super layoutSubviews];
    
    self.lbl_name.frame = CGRectMake(15, 15, (SCREEN_WIDTH - 30)/ 2, 15);
    
    self.lbl_detail.frame = CGRectMake(15, CGRectGetMaxY(self.lbl_name.frame) + 10, SCREEN_WIDTH - 30, 15);
    
    self.lbl_time.frame = CGRectMake(15, CGRectGetMaxY(self.lbl_detail.frame) + 10, SCREEN_WIDTH - 30, 15);
    
    self.view_Line.frame = CGRectMake(10, CGRectGetMaxY(self.lbl_time.frame) + 10, SCREEN_WIDTH - 10, 1);
    
    self.lbl_price.frame = CGRectMake(CGRectGetMaxX(self.lbl_name.frame) + 5, 15, (SCREEN_WIDTH - 30)/ 2, 15);
}


@end
